package com.EM1.www.service;
import com.EM1.www.dao.ConnectUser;
import com.EM1.www.constant.*;
import com.EM1.www.po.User;
import java.util.ArrayList;

public class CheckUSer {
    public String okUser(String username, String password, String okpassword) throws Exception {

                ConnectUser connectUser = new ConnectUser();
                User user = connectUser.selectusername(username);
                if (user != null) {
                    return "用户名已存在";
                }
                return null;
            }
    public String verifyUSer(String username,String password) throws Exception {
        ConnectUser connectUser=new ConnectUser();
        User user = connectUser.selectusername(username);
        if(user==null){
            return "用户名不存在";
        }else {
            if(user.getPassword().equals(password)){
                return null;
            }else {
                return "密码错误";
            }
        }
    }
}
